<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <title>跑么杯</title>
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/iconfont.css?v=15" />
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/base.css?v=15" />
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/run.css?v=131" />
    <script src="{$staticHost}/static/js/jquery.min.js"></script>
    <script src="{$staticHost}/static/js/js.js"></script>
    <script src="{$staticHost}/static/js/mod.js"></script>
    </head>
<body class="pb60">

  {if $isTop==0}{template 'paome/run/share-tips'}{/if}
  <div id="mask-box" class="masklayer">
    <section class="pao-tier">
      <span class="pao-close"></span>
      <dl >
        <dt class="tier-title club-blueq">已创建战队</dt>
        <dd class="tier-text">
          您已经开通竞赛资格，<br/>
          邀请好友快快参与竞赛吧！
        </dd>
        <dd class="tier-btn">确定</dd>
      </dl>
    </section>
  </div>
  <section id="title-box" class="paome"></section>
  <!-- 跑么杯海报 -->
  <script id="home-title" type="text/html">
    <img src="/static/images/img/paome.png"/>
    <!-- 跑么杯图片 -->
    <div class="ing">
      <i class="flag"></i>
      <% if(currentRound == 1) { %>第一轮<% } else if(currentRound == 2) { %>第二轮<% } else {%>冠军争霸赛<% } %><% if(currentPhase == 1) { %>即将开始<% } else if(currentPhase == 8) {%>进行中<% } else {%>已结束<% } %>
      <%=start_time%>
      <% if(start_time) { %>-<% } %>
      <%=end_time%>
    </div>
    <ul class="time-list"<% if(currentRound == 4) { %> style="border:none"<% } else if(!currentRound) {%> style="display:none"<% } %>>
      <% if(currentRound != 4) { %>
      <li<% if(currentPhase == 2) { %> class="on"<% } %>>预选赛　<%=qualifying_start%>-<%=qualifying_end%></li>
      <li<% if(currentPhase == 3) { %> class="on"<% } %>>冠军赛　<%=championship_start%>-<%=championship_end%></li>
      <% } else { %>
      <li class="on">冠军争霸赛　<%=start_seconds%>-<%=end_seconds%></li>
      <% } %>
    </ul>
    <!-- 时间标注 -->
    <div class="pao-bar">
      <% for(var i = 1; i <= 3; i++) { %>
      <% if(i == 3) {i = 4} %>
      <span class="<% if(i < currentRound) { %>color-pink<% } else if(i == currentRound){ %>pink<% } %>"><i class="flag"></i></span>
      <% } %>
      <p id="bar-line" style="width: <%=currentRoundProcess%>%;"></p>
    </div>
    {if !$isInClub}
    <!-- 进度条 -->
    <!-- <ul class="expalin-list">
      <li>创建或加入一个战队，进行战队总里程、配速和人气比拼争夺奖励</li>
      <li>每个战队至少5人才有资格参与比赛，战队上限30人</li>
      <li>本次比赛包含2轮常规赛以及最后的冠军争霸赛，周期共35天</li>
      <li> 冠军争霸赛每位成员可免费获得完赛奖牌，最高获得5000元物资奖励</li>
    </ul>
     跑么杯参赛说明 已参加后此区域隐藏  expalin-list
    <dl class="getof">
      <dt>
        专属荣誉:
        <b>奖杯 勋章 证书</b>
      </dt>
      <dt>
        至尊象征:
        <b>全站最强战队霸主地位</b>
      </dt>
      <dd class="examine">查看详情</dd>
    </dl> -->
    {/if}
    <!-- 已参加后此区域隐藏 getof-->
  </script>
  <h4 class="blue-line line-gray-bottom" style="padding-top: 20px;padding-bottom: 15px;">
    跑么杯规则
    <a style="position:relative; bottom:5px;" class="examine fr">查看详情</a>
  </h4>
  <!-- 已参加后查看按钮显示 -->
  {if $isInClub}
  <dl class="today-data line-gray-bottom"></dl>

  <script id="dataToday" type="text/html">
    <%if(result.clubData){%>
    <dt class="blue-line line-gray mb10">今日战队数据</dt>
    <dd class="pr">
      <a class="pa" style="width: 100%; height: 100%;left: 0" href="clubDetailNo?clubId=<%=result.clubData.club_id%>"></a>
      <img src="<%=result.clubData.club_header%>">
      <h3><%=result.clubData.club_name%></h3>
      <div class="data-all">
        <span>
          总跑量榜
          <b>
            <%if(result.clubData.club_mileage){%>
              <%=result.clubData.club_mileage%>km
            <%}else{%>
              --
            <%}%>
          </b>
          排名
          <%if(result.clubData.club_mileage_rank==null){%> -- <%}else{%> <%=result.clubData.club_mileage_rank%> <%}%> 
          积分 <%if(result.clubData.mileage_score==0){%> -- <%}else{%> <%=result.clubData.mileage_score%> <%}%>
        </span>
        <span>
          配速榜
          <b>
           <%if(result.clubData.club_speed=="00'00''"){%>
              --
            <%}else{%>
             <%=result.clubData.club_speed%>
            <%}%>
          </b>
          排名 <%if(result.clubData.club_speed_rank==null){%> -- <%}else{%> <%=result.clubData.club_speed_rank%> <%}%> 
          积分 <%if(result.clubData.speed_score==0){%> -- <%}else{%> <%=result.clubData.speed_score%> <%}%>
        </span>
        <span>
          人气榜
          <b>
            <%if(result.clubData.club_supporters){%>
              <%=result.clubData.club_supporters%>
            <%}else{%>
              --
            <%}%>
          </b>
          排名 <%if(result.clubData.club_supporters_rank==null){%> -- <%}else{%> <%=result.clubData.club_supporters_rank%> <%}%> 
          积分 <%if(result.clubData.support_score==0){%> -- <%}else{%> <%=result.clubData.support_score%> <%}%>
        </span>
      </div>
      <p>
        今日实时总积分(可获得)
        <%if(result.clubData.today_score==0){%>
        --
        <%}else{%>
        <%=result.clubData.today_score%>
        <%}%>
        <span class="fr">
          已累计积分：
          <%if(result.clubData.total_score==0){%> -- <%}else{%> <%=result.clubData.total_score%> <%}%>
        </span>
      </p>
    </dd>
    <dd class="line-tgray p10 color_gray ml10">
      实时总积分基于您战队当前三个榜单排名积分，根据积分可及时调整战队作战策略，依次预估战队最终累计积分排名。
    </dd>
    <%}%>
  </script>
  <!-- 今日战队数据 第二期增加 -->
  {/if}

  <div id="taotai" class="dn">
    <p class="ptb30 ac color-blue f14"></p>
    <a class="round-blue jx" style="display:none">带领团队参与第二轮</a>
  </div>
  <div id="yizhaomu" class="dn">
    <div id="joined_club_info" class="p20 ac"></div>
    <a class="round-blue" id="share_button">邀请好友</a>
  </div>
  <div id="index_rank" class="dn">
  <!-- 未参加战队内容 -->
  <h4 class="blue-line line-gray-bottom dn">我的战队总里程排名区间</h4>
  <ul class="cs-rank dn"></ul>
  <h4 class="blue-line line-gray">战队明星成员</h4>
  <section class="me-club-star mt10"></section>
  <!-- 明星成员 -->
  </div>
 <!-- 上一轮预选未能晋级提示 -->
  <!-- 未能晋级页面 -->

  <!-- 引入招募期页面 -->
  <nav class="homenav">
    <a class="on" href="paomeHome"><i class="iconfont icon-zhuye"></i>首 页</a>
    <a href="paomeRank"><i class="iconfont icon-paihangbang"></i> 排行榜</a>
    <a href="paoLobby"><i class="iconfont icon-dating"></i>大 厅</a>
    <a href="meCenter">
       <i class="iconfont icon-wode">
           {if $msgNoReadNum>0}
            <sub id="nav-news">●</sub>
           {/if}
        </i>
        我的
    </a>
  </nav>
</body>

<script id="index_rank_list_tpl" type="text/html">
<% if(list != undefined) { %>
<% for(var i in list) { %>
  <li class="<% if(i == 'currentClub') { %>club-blue me-num<% } %>" style="padding-bottom: 10px;">
    <span class="contrast<% if(list[i].changeDesc.num * 1 < 0) { %> down<% } else if(list[i].changeDesc.num * 1 > 0) { %> up<% } %>">
      <b><% if(!list[i].rank) { %>-<% } else { %><%=list[i].rank%><% } %></b>
      <%=list[i].changeDesc.desc%>
    </span>
    <a href="clubDetailNo?clubId=<%=list[i].clubId%>">
      <img class="cs-logo" src="<%=list[i].image%>"/>
    </a>
    <!-- 战队logo -->
    <dl>
      <dt><%=list[i].title%></dt>
      <dd>
        <span>
          今日新增
          <b><%=list[i].tdInc%>km</b>
        </span>
        <span>
          总里程
          <b><%=list[i].mile%>km</b>
        </span>
        <span>
          排名
          <b><% if(!list[i].rank) { %>-<% } else { %><%=list[i].rank%><% } %></b>
        </span>
      </dd>
    </dl>
  </li>
<% } %>
<% } %>
</script>
<script id="index_rank_star_tpl" type="text/html">
  <span><% if(label == 'max_mileage') { %>单次最远距离<% } else if(label == 'speed') { %>打破配速纪录<% } else if(label == 'support_num') { %>最受欢迎的竞赛成员<% } else if(label == 'mileage') { %>最能跑的竞赛成员<% } %></span>
  <div>
    <img class="user user-data" data-id="<%=uid%>" src="<%=header%>"/>
    <p>
      <b class="db"><%=nickname%></b>
      <% if(label == 'max_mileage') { %>
      单次最远距离<%=max_mileage%>km
      <% } else if(label == 'speed') { %>
      配速<%=speed%>/km
      <% } else if(label == 'support_num') { %>
      人气<%=support_num%>
      <% } else if(label == 'mileage') { %>
      累计里程<%=mileage%>km
      <% } %>
    </p>
    <a href="clubDetailNo?clubId=<%=club_id%>">
      <img  data-id="<%=club_id%>" src="<%=club_header%>?imageView2/2/w/128"/>
    </a>
  </div>
</script>
<script id="recomment_club_tpl" type="text/html">
<li class="club_info" data-id="<%=id%>">
  <h6 class="club-<%=top_color%>"><%=top_desc%></h6>
  <a href="clubDetailNo?clubId=<%=id%>"><img class="club-img" src="<%=image%>?imageView2/2/w/128"/>
  <ol>
    <li class="color_dakgray"><%=name%></li>
    <li class="color_dakgray">已招募  <%=user_num%>/30人</li>
  </ol>
  </a>
  <div>
    <% if(is_join == 2) { %>
    <button class="bg_gray color-white" type="button">已加入</button>
    <% } else if(is_join == 1) { %>
    <button class="bg_blue" type="button">待审核</button>
    <% } else {%>
    <button data-id="<%=id%>" class="join_club" type="button">加入</button>
    <% } %>
    <img id="tz-img" src="<%=head_image%>"/>
    <span class="color_gray">队长</span>
  </div>
  <p>推荐原因：<%=bottom_desc%></p>
</li>
</script>
<script id="joined_club_info_tpl" type="text/html">
  <span class="color_gray">您的战队<span class="color-blue"><%=title%></span>已招募</span>
  <p class="color-blue f32 p10"><%=user_num%>/30<span class="f13">人</span></p>
  <span class="f14 color-blue"><% if(user_num * 1 >= 5){ %>您已获得了本轮的竞赛资格<% } else { %>5人以上才有竞赛资格哦，快去邀请好友参加竞赛吧<% } %></span>
  <p class="p10 line-tgray color_gray f13 mt10">竞赛即将开始，快去训练备战吧!</p>
</script>
<section id="cs" class="masklayer" >
 <div class="pao-tier" style="top: 20%;width: 90%;left:5%;">
    <span class="pao-close"></span>
    <div class="tier-colonel">
      <img id="img-box" src="">
      <span class="dib vm">队长：<i id="tz-box"></i></span>
      <p id="in-box" class="p10 f14 line-tgray mt10"></p>
     </div>
  </div>
</section>
{template 'paome/run/tier-energy'}
<script type="text/javascript">
  var uid = "{$uid}";
  var sup = typeof jw == "object";
  $("#found-cs").click(function(){
    if(!uid){
      if(!sup){
         window.location.href='http://a.mlinks.cc/Aagn?url='+encodeURIComponent('{$staticHost}/paome_webIndex/paomeHome')
      }else{
        window.location.href="joggers://login";
      }
    }else{
      window.location.href="ClubFound"
    }
  })

  var isClickJoin = false;
  $(function(){
      if(sup){
        // 创建成功弹框
        var tip = getParam('tip') * 1;
        if(tip == 1) {
            $('#mask-box').show();
        }

        $('#share_button').live('click', function() {
            jw.api('share', JSON.stringify({'channel': ''}));
        });
      }
      $.get('{$appHost}/paome_home/paomeHome', renderHome);
      {if $isInClub}$.get('{$appHost}/paome_home/ClubDataInZb', clubDataTo);{/if}
      $('.join_club').live('click', function(){
        var club_id = $('.club_info').attr('data-id') * 1;
        if(sup){
          nologin();
          if(isClickJoin) {
            return;
          }
          isClickJoin = true;
          var o = this;
          if(club_id) {
              $.post('{$appHost}/paome_webIndex/joinClub', {'clubId': club_id}, function(res){
                  var res = JSON.parse(res);
                  if(res.error != undefined) {
                      alert(res.error.text);
                  } else if(res.result != undefined) {
                    if(res.result.is_success * 1 == 1) {
                      $(o).addClass('bg_blue').text('待审核');
                    }
                  }
              });
          }
        }else{
          var club_id = $(this).attr('data-id')
          var qq = 'http://a.mlinks.cc/Aagn?url='+encodeURIComponent('{$staticHost}/paome_webIndex/clubDetailNo?clubId='+club_id);
          window.location.href=qq;
        }
      });
  });
  function clubDataTo(data){
    data = JSON.parse(data);
    console.log(data)
    if(uid){
      data.result.clubData.total_score =Number(data.result.clubData.total_score).toFixed(0)
      var html = template('dataToday', data);
      $('.today-data').html(html); 
    }else{
      $(".today-data").hide()
      $(".blue-line").removeClass('line-gray-bottom')
    }
  }
  function renderHome(data) {
      data = JSON.parse(data);
      var isJoin = data.result.homeInfo.isJoin * 1;
      var currentRound = data.result.timeRang.currentRound * 1;

      if(data.result.recommentClub != undefined && data.result.recommentClub) {
        var html = ''
        for(x in data.result.recommentClub){
          var club = {
            'id': data.result.recommentClub[x].id,
            'image': data.result.recommentClub[x].image,
            'name': data.result.recommentClub[x].title,
            'user_num': data.result.recommentClub[x].user_num,
            'head_uid': data.result.recommentClub[x].head_uid,
            'head_image': data.result.recommentClub[x].leader_head ? data.result.recommentClub[x].leader_head : '/static/images/bg/group_image_nor-min.png',
            'is_join': data.result.homeInfo.isJoin * 1,
            'top_color': data.result.recommentClub[x].user_num * 1 < 5 ? 'blue' : 'pink',
            'top_desc': data.result.recommentClub[x].user_num * 1 < 5 ? '满足5人就可以比赛啦' : '竞赛开始即可进行比赛',
            'bottom_desc': data.result.recommentClub[x].user_num * 1 < 5 ? '优质战队，队长带队经验丰富' : '竞赛马上开始，就差你啦',
              
          };
          club.user_num = club.user_num < 10 ? '0' + club.user_num : club.user_num;
           {template 'paome/run/share-box'}
          html = html + template('recomment_club_tpl', club);
        }

        $('.recomment_club').html(html);
        for(x in data.result.recommentClub){
          if(data.result.recommentClub[x].head_introduce.length>0){
            $("#tz-img").click(function(){
              $("#cs").show();
              $("#img-box").attr("src",data.result.recommentClub[x].leader_head)
              $("#tz-box").html(data.result.recommentClub[x].leader_name)
              if(data.result.recommentClub[x].head_introduce.length>0){
                $("#in-box").html(data.result.recommentClub[x].head_introduce)
              }else{
                $("#in-box").html("优质战队，队长带队经验丰富")
              }
            })
            $(".pao-close").click(function(){
              $(".masklayer").hide();
            })
          }
        }
          
      }

      // 争霸赛未参与
      if(isJoin < 2) {
        var tip = '本赛季跑么杯已经结束<br />非常感谢各位参赛者的付出！感谢各位参与者的包容与厚爱，请尽情期待下一季吧';
        $('#taotai p').html(tip);
        $('#taotai').show();
        $('.today-data').hide();
      }

      if(data.result.clubInfo != undefined && data.result.clubInfo) {
        var clubStatus = data.result.homeInfo.clubStatus * 1;
        var currentPhase = data.result.timeRang.currentPhase * 1;
        var csn = data.result.homeInfo.clubStatusNew * 1;
        var isChampions = data.result.clubInfo.isChampions * 1;
        var scoreRank = data.result.clubInfo.scoreRank * 1;

        if(csn == 7 && currentRound == 2) {
          csn = 8;
        }

        if(csn == 12 && currentRound == 4) {
          csn = 16;
        }

        if(csn == 15 && isChampions == 1) {
          csn = 1;
          if(currentPhase == 1) {
            $('.today-data').hide();
          }
        }

        if(csn == 15 && isChampions == 0) {
          csn = 16;
        }

        if(csn == 2 && clubStatus == 2) {
          csn = 16;
        }

        if(csn == 1 || csn == 9) {
          // 赛季未开始及招募期
          var club = {
              'id': data.result.clubInfo.id,
              'user_num': data.result.clubInfo.user_num,
              'title': data.result.clubInfo.title,
              'start_time':data.result.timeRang.start_time,
              'end_time':data.result.timeRang.end_time,
              'championship_start':data.result.timeRang.championship_start,
              'championship_end':data.result.timeRang.championship_end,
              'qualifying_start':data.result.timeRang.qualifying_start,
              'qualifying_end':data.result.timeRang.qualifying_end,
          };
          club.user_num = club.user_num < 10 ? '0' + club.user_num : club.user_num;
          var html = template('joined_club_info_tpl', club);
          $('#joined_club_info').html(html);         
          $('#yizhaomu').show();

          if(typeof jw == "object") {
            jw.api('set_share_info', JSON.stringify({
              'title': '我正在参与跑么杯争霸赛，快来加入我的战队赢取5000元奖励吧！',
              'description':'11月14日，就在虎扑跑步',
              'img_url':'http://irun.hupu.com/static/images/share/pao.png',
              'link_url':'{$staticHost}/paome_webIndex/paoShare?clubId=' + club.id,
            }));
          }
        } else if(csn == 2 || csn == 4 || csn == 5 || csn == 7 || csn == 8 || csn == 10 || csn == 12 || csn == 13 || csn == 15 || csn == 16 || csn == 26) {
          $('.today-data').hide();
          var tips = {
            '2': '您的俱乐部在本轮预选赛竞赛期间未招满5-30人，请继续招募参与下一轮获得争霸赛资格吧。',
            '4': '本阶段竞赛已经停止统计，请在今日24：00前尽快上传个人跑量成绩超过则不再统计至战队排行！<br />24:00点时公布您是否晋级，尽情期待吧！',
            '5': '您的战队在预选赛中未能晋级冠军赛，胜败乃兵家常事千万表灰心，继续下一轮肯定会夺取争霸赛资格哦！',
            '7': '本阶段竞赛已经停止统计，请在今日24：00前尽快上传个人跑量成绩超过则不再统计至战队排行！<br />24:00点时公布您是否晋级，尽情期待吧！',
            '8': '您的战队在冠军赛中未能晋级争霸赛，胜败乃兵家常事千万表灰心，继续下一轮肯定会夺取争霸赛资格哦！',
            '8-1': '太棒了！精诚所至金石为开您的战队获得了总决赛冠军争霸赛的资格！别傲娇哦！更激烈的争霸赛来了！<br />快点休养生息做好赢取争霸赛三冠王的备战训练吧！',
            '10': '很遗憾您的战队在本轮预选赛竞赛期间未招满5-30人已被淘汰！本季跑么杯常规赛已截止招募！<br />想继续参与跑么杯可加入已获得资格的战队哦！',
            '12': '本轮预选赛已结束了，请在24点前上传自己的个人成绩，否则将会失效哦！',
            '13': '您的战队在预选赛中未能晋级冠军赛，本季跑么杯常规赛已截止招募！想继续参与跑么杯可加入已获得资格的战队哦！',
            '15': '本阶段竞赛已经停止统计，请在今日24：00前尽快上传个人跑量成绩超过则不再统计至战队排行！<br />24:00点时公布您是否晋级，尽情期待吧！',
            '16': '很遗憾您的战队在本轮冠军赛未能晋级争霸赛！本季跑么杯常规赛已截止招募！想继续参与跑么杯可加入已获得资格的战队哦！',
            '16-1': '太棒了！精诚所至金石为开您的战队获得了总决赛冠军争霸赛的资格！别傲娇哦！更激烈的争霸赛来了！<br />快点休养生息做好赢取争霸赛三冠王的备战训练吧！',
            '26': '本阶段竞赛已经停止统计，请在今日24：00前尽快上传个人跑量成绩超过则不再统计至战队排行！<br />24:00点时公布您的名次，尽情期待吧！',
            '26-1': '本赛季跑么杯已经结束<br /><br />',
          };
          
          var sk = csn;
          var tip;

          if(csn == 8 || csn == 16) {
            sk += isChampions == 1 ? '-1' : '';
          } else if(csn == 26) {
            sk += (currentPhase == 7 || isNaN(currentPhase)) ? '-1' : '';
          }

          tip = tips[sk];

          if(csn == 26 && isNaN(currentPhase) && !isNaN(scoreRank)) {
            if(scoreRank == 1) {
              tip += '太棒啦！您的战队荣获积分榜冠军！获得了5000元大礼包和奖牌、奖杯、证书、电子勋章！';
            } else if(scoreRank >= 2 && scoreRank <= 5) {
              tip += '太棒啦！您的战队荣获积分榜第' + scoreRank + '名获得了1000元大礼包和奖牌、证书、电子勋章！';
            } else if(scoreRank >= 6 && scoreRank <= 10) {
              tip += '太棒啦！您的战队荣获积分榜第' + scoreRank + '名获得了500元大礼包和奖牌、证书、电子勋章！';
            } else {
              tip += '诶呀呀！您的战队在本赛季获得了奖牌、证书、电子勋章！'
            }
          }

          // 参加下一轮的按钮
          if(csn == 2 || csn == 5 || csn == 8) {
            if(data.result.clubInfo.isLeader * 1 == 1) {
              $('#taotai a').show();
            }
          }

          $('#taotai p').html(tip);
          $('#taotai').show();
        } else if(csn == 3 || csn == 6 || csn == 11 || csn == 14 || csn == 25) {
          // 进行中
          // 明星成员
          getPaomeApi('get', '/paome_home/homeStarUser', {}, function(rankData){
            if(rankData.starUser != undefined && rankData.starUser) {
              var html = template('index_rank_star_tpl', rankData.starUser);
              $('#index_rank .me-club-star').html(html);
              ljj()
            }
          });
          // 排名
          getPaomeApi('get', '/paome_webIndex/getHomeClubRankList', {}, function(rankData){
            var html = template('index_rank_list_tpl', rankData);
            $('#index_rank .cs-rank').html(html);
          })

          $('#index_rank').show();
        }
      }

      var club = {
          'start_time':data.result.timeRang.start_time,
          'end_time':data.result.timeRang.end_time,
          'championship_start':data.result.timeRang.championship_start,
          'championship_end':data.result.timeRang.championship_end,
          'qualifying_start':data.result.timeRang.qualifying_start,
          'qualifying_end':data.result.timeRang.qualifying_end,
          'currentPhase': data.result.timeRang.currentPhase * 1,
          'currentRound': data.result.timeRang.currentRound * 1,
          'currentRoundProcess': data.result.timeRang.currentRound == 1 ? 20 : (data.result.timeRang.currentRound == 2 ? 50 : 80),
          'start_seconds': data.result.timeRang.start_seconds,
          'end_seconds': data.result.timeRang.end_seconds
      };
      var html = template('home-title', club);
      $('#title-box').html(html);

      if(data.result.timeRang.length == 0) {
        $('.pao-bar span').addClass('color-pink')
        $('#bar-line').attr({'style': 'width:100%'})
      }

      $('#taotai a').click(function(){
        getPaomeApi('get', '/paome_webIndex/clubSignUpGame', {}, function(data){
          if(data.is_success != undefined && data.is_success * 1 == 1) {
            alert('报名成功!');
            window.history.go(0);
          }
        });
      });

    $(".examine").click(function(){
      if(!sup){
          window.location.href="http://irun.hupu.com/topic/4724964.html"
        }else{
          window.location.href="joggers://topic/4724964";
        }
    })
  }

  function nologin() {
      if(!uid){
          if(!sup){
              window.location.href="http://mobile.hupu.com/download/joggers?r=share"
          }else{
              window.location.href="joggers://login";
          }
          return;
      }
  }
  $(".tier-btn,.pao-close").click(function(){
    $('.masklayer').hide();
  })

function getParam(par){
    var local_url = document.location.href; 
    var get = local_url.indexOf(par +"=");
    if(get == -1){
        return false;   
    }   
    var get_par = local_url.slice(par.length + get + 1);    
    var nextPar = get_par.indexOf("&");
    if(nextPar != -1){
        get_par = get_par.slice(0, nextPar);
    }
    return get_par;
}
</script>

{template 'show/web-footer'}
